package com.orange.score.activity.entry;

import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.app.NotificationManager;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import com.exchange.View.ExchangeViewManager;
import com.orange.score.activity.common.CommonFootballActivity;
import com.orange.score.activity.more.AboutWebsiteActivity;
import com.orange.score.activity.more.FeedbackActivity;
import com.orange.score.activity.more.FinalScoreActivity;
import com.orange.score.activity.more.MoreAdapter;
import com.orange.score.activity.more.ScorePromptActivity;
import com.orange.score.activity.more.WeeklyScheduleActivity;
import com.orange.score.app.ScoreApplication;
import com.orange.score.constants.LanguageType;
import com.orange.score.model.config.ConfigManager;
import com.orange.score.service.UserService;
import java.util.ArrayList;
import java.util.List;

public class MoreActivity extends CommonFootballActivity
{
  public static final int ABOUT_WEBSITE = 6;
  public static final String CHECKCLIENT_URL = "http://bf.bet007.com/phone/android_ver.txt";
  public static final int EXCHANGE = 8;
  public static final int EXIT = 9;
  public static final int FEEDBACK = 4;
  public static final int FINISH_SCORE = 0;
  public static final int RECOMMEND = 5;
  public static final int SET_LANGUAGE = 3;
  public static final int SET_SCORE_PROMPT = 2;
  public static final String TAG = "MoreActivity";
  public static final int UPDATE = 7;
  public static final String UPDATECLIENT_URL = "http://bf.bet007.com/phone/down/Android";
  public static final int WEEKLY_MATCH = 1;
  private ListView listView;

  private void aboutWebsite()
  {
    Intent localIntent = new Intent();
    localIntent.setClass(this, AboutWebsiteActivity.class);
    startActivity(localIntent);
  }

  private void exchange()
  {
    new ExchangeViewManager().addView(this, null, 7, new String[0]);
  }

  private void exit()
  {
    AlertDialog.Builder localBuilder = new AlertDialog.Builder(this);
    localBuilder.setTitle(2131361817);
    localBuilder.setPositiveButton(2131361815, new DialogInterface.OnClickListener(this)
    {
      public void onClick(, int paramInt)
      {
        this.this$0.exitApp();
        ((NotificationManager)this.this$0.getSystemService("notification")).cancel(2130837635);
      }
    });
    localBuilder.setNegativeButton(2131361816, new DialogInterface.OnClickListener(this)
    {
      public void onClick(, int paramInt)
      {
      }
    });
    localBuilder.create().show();
  }

  private void feedFack()
  {
    Intent localIntent = new Intent();
    localIntent.setClass(this, FeedbackActivity.class);
    startActivity(localIntent);
  }

  private List<String> getData()
  {
    ArrayList localArrayList = new ArrayList();
    localArrayList.add("完场比分");
    localArrayList.add("一周赛程");
    localArrayList.add("比分提示及推送设置");
    localArrayList.add("语言简繁设置");
    localArrayList.add("信息反馈");
    localArrayList.add("推荐给好友");
    localArrayList.add("关于球探网");
    localArrayList.add("客户端更新");
    localArrayList.add("更多精品应用");
    localArrayList.add("退出客户端");
    return localArrayList;
  }

  private void initListView()
  {
    this.listView = ((ListView)findViewById(2131558665));
    this.listView.setSelectionAfterHeaderView();
    MoreAdapter localMoreAdapter = new MoreAdapter(this, 2130903077, getData());
    this.listView.setAdapter(localMoreAdapter);
    this.listView.setFastScrollEnabled(true);
    this.listView.setOnItemClickListener(new AdapterView.OnItemClickListener(this)
    {
      public void onItemClick(, View paramView, int paramInt, long paramLong)
      {
        switch (paramInt)
        {
        default:
        case 0:
        case 1:
        case 2:
        case 3:
        case 4:
        case 5:
        case 6:
        case 7:
        case 8:
        case 9:
        }
        while (true)
        {
          while (true)
          {
            while (true)
            {
              while (true)
              {
                while (true)
                {
                  while (true)
                  {
                    while (true)
                    {
                      while (true)
                      {
                        while (true)
                        {
                          while (true)
                          {
                            return;
                            this.this$0.finishScore();
                          }
                          this.this$0.weeklyMatch();
                        }
                        this.this$0.setScorePrompt();
                      }
                      MoreActivity.access$0(this.this$0);
                    }
                    MoreActivity.access$1(this.this$0);
                  }
                  MoreActivity.access$2(this.this$0);
                }
                MoreActivity.access$3(this.this$0);
              }
              MoreActivity.access$4(this.this$0);
            }
            MoreActivity.access$5(this.this$0);
          }
          MoreActivity.access$6(this.this$0);
        }
      }
    });
  }

  private void recommend()
  {
    4 local4 = new DialogInterface.OnClickListener(this)
    {
      public void onClick(, int paramInt)
      {
        Log.d("MoreActivity", "click " + paramInt);
        paramDialogInterface.dismiss();
        String str = "朋友，我正在用球探彩客网的比分客户端看即时比分、赔率、分析数据，感觉很不错，下载地址是:".concat("http://bf.bet007.com/phone/down/Android");
        if (paramInt == 0)
        {
          Intent localIntent1 = new Intent("android.intent.action.SENDTO", Uri.parse("sms:"));
          localIntent1.putExtra("sms_body", str);
          this.this$0.startActivity(localIntent1);
        }
        while (true)
        {
          return;
          Intent localIntent2 = new Intent("android.intent.action.SEND");
          localIntent2.setType("plain/text");
          String[] arrayOfString = new String[1];
          arrayOfString[0] = "";
          localIntent2.putExtra("android.intent.extra.EMAIL", arrayOfString);
          localIntent2.putExtra("android.intent.extra.SUBJECT", "推荐球探彩客网的比分客户端");
          localIntent2.putExtra("android.intent.extra.TEXT", str);
          this.this$0.startActivity(Intent.createChooser(localIntent2, str));
        }
      }
    };
    new AlertDialog.Builder(this).setTitle(2131361820).setSingleChoiceItems(2131165184, -1, local4).setNegativeButton(2131361823, new DialogInterface.OnClickListener(this)
    {
      public void onClick(, int paramInt)
      {
        Log.d("MoreActivity", "click cancel");
      }
    }).create().show();
  }

  private void setLanguage()
  {
    2 local2 = new DialogInterface.OnClickListener(this)
    {
      public void onClick(, int paramInt)
      {
        Log.d("MoreActivity", "click " + paramInt);
        paramDialogInterface.dismiss();
        Log.i("MoreActivity", "whichButton=" + paramInt);
        if (paramInt == 0)
        {
          ConfigManager.setLanguage(0);
          Log.i("MoreActivity", "select LanguageType.MANDARY");
        }
        while (true)
        {
          while (true)
          {
            ScoreApplication.gotoRealtimeMatchTab(true);
            return;
            if (paramInt != 1)
              break;
            ConfigManager.setLanguage(1);
            Log.i("MoreActivity", "select LanguageType.CANTONESE");
          }
          ConfigManager.setLanguage(2);
          Log.i("MoreActivity", "select LanguageType.CROWN");
        }
      }
    };
    LanguageType localLanguageType = ConfigManager.getLanguage();
    new AlertDialog.Builder(this).setTitle(2131361821).setSingleChoiceItems(2131165187, localLanguageType.intValue(), local2).setNegativeButton(2131361823, new DialogInterface.OnClickListener(this)
    {
      public void onClick(, int paramInt)
      {
        Log.d("MoreActivity", "click cancel");
      }
    }).create().show();
  }

  private void upadteClient()
  {
    new UserService().updateClient(this, "http://bf.bet007.com/phone/android_ver.txt", "http://bf.bet007.com/phone/down/Android");
  }

  protected void finishScore()
  {
    Intent localIntent = new Intent();
    localIntent.setClass(this, FinalScoreActivity.class);
    startActivity(localIntent);
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    requestWindowFeature(1);
    setContentView(2130903101);
    initListView();
  }

  protected void onPause()
  {
    super.onPause();
    this.listView.setSelectionAfterHeaderView();
    ScoreApplication.currentActivity = null;
  }

  protected void onResume()
  {
    super.onResume();
    this.listView.setSelectionAfterHeaderView();
    ScoreApplication.currentActivity = this;
  }

  protected void setScorePrompt()
  {
    Intent localIntent = new Intent();
    localIntent.setClass(this, ScorePromptActivity.class);
    startActivity(localIntent);
  }

  protected void weeklyMatch()
  {
    Intent localIntent = new Intent();
    localIntent.setClass(this, WeeklyScheduleActivity.class);
    startActivity(localIntent);
  }
}